import Vue from 'vue'
import VueRouter from 'vue-router'
//注册页面
import Login from '@/views/Login.vue'
//后台主页
import Home from '@/views/Home.vue'
//用户管理
import User from '@/views/User.vue'
//角色管理
import Right from '@/views/Right.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: Login
  },
  {
    path: '/home',
    name: 'home',
    component: Home,
    children:
      [
        {
          path: '/user',
          name: 'user',
          component: User
        },
        {
          path: '/right',
          name: 'right',
          component: Right
        }
      ]
  }
]

const router = new VueRouter({
  routes
})

export default router
